package com.training.java.core.collections.cellPhone.pre15;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

public class CellPhoneDemo {
	
	public static void main(String[] args)
	{
		CellPhone nokia = new CellPhone("Nokia", "Dual sim", "ios7");
		CellPhone galaxy = new CellPhone("Samsung", "Galaxy S4", "Android");
		CellPhone iPhone = new CellPhone("Apple", "iPhone 5C", "ios7");
		
		List cells = new ArrayList();
		cells.add(nokia);
		cells.add(galaxy);
		cells.add(iPhone);
		
		Iterator cellsIterator = cells.iterator();
		
		while(cellsIterator.hasNext())
		{
			CellPhone aphone = (CellPhone) cellsIterator.next();
			System.out.println("Make is " + aphone.getMake());
			System.out.println("Model is " + aphone.getModel());
			System.out.println("Operating System is " + aphone.getOperatingSystem());
			System.out.println("************");
		}
		
	}

}
